home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / cg / epsload.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-28  |  2KB  |  85 lines

  1. /* EpsLoad.rexx -- Convert and load an EPS file.           */
  2. /* By Bob Caron © 1994 NewTek, Inc.                        */
  3.  
  4. call addlib(CG_AREXX,0)
  5.  
  6. if ~exists("Toaster:Brushes") then address command "c:makedir toaster:Brushes"
  7.  
  8. filnam = 'ENV:EpsLoad.state'
  9. version = 'EpsLoad v1.4'
  10.  
  11. if (exists(filnam)) then do
  12.     if (~open(state, filnam, 'R')) then break
  13.     if (readln(state) ~= version) then break
  14.     file=readln(state)
  15.     end
  16.     call close state
  17.  
  18. if lastpos('/',file,length(file)-1)~=0 then do
  19.    filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
  20.    path=left(file,(lastpos('/',file,length(file))-1))
  21.    end
  22. else do
  23.    filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
  24.    path=left(file,(lastpos(':',file,length(file))))
  25.    end
  26.  
  27. if file="FILE" | file="" then do
  28.    path="Toaster:PSFonts/"
  29.    filenam=""
  30.    end
  31.  
  32. infile=REQ_file("Choose an EPS File:",filenam,path)
  33.  
  34.  
  35. if infile="" then
  36.    exit
  37.  
  38. file=script
  39. if (open(state, filnam, 'W')) then do
  40.     call writeln state, version
  41.     call writeln state, infile
  42.     call close state
  43. end
  44.  
  45. width=0
  46. height=0
  47.  
  48.  
  49. if GET_LINE(TYPE) = 'Box' then do
  50.    width=word(get_rect(SIZE),1)
  51.    height=word(get_rect(SIZE),2)
  52.    end
  53.  
  54. if (width+height)<=0 then do
  55.    call req_tell("Error: You must create a box","and then select it.")
  56.    exit
  57.    end
  58.  
  59. if lastpos('/',infile,length(infile)-1)~=0 then do
  60.    filenam=right(infile,(length(infile)-lastpos('/',infile,length(infile)-1)))
  61.    path=left(infile,(lastpos('/',infile,length(infile))-1))
  62.    end
  63. else do
  64.    filenam=right(infile,(length(infile)-lastpos(':',infile,length(infile)-1)))
  65.    path=left(infile,(lastpos(':',infile,length(infile))))
  66.    call req_tell("here2")
  67.    end
  68.  
  69. call req_bar("Converting EPS File...")
  70. address command "C:psimage "||value("infile")||" toaster:brushes/"||value("filenam")||"."||value("height")||" "||value(width)||" "||value("height")||" "
  71.  
  72. call LOADBRUSH("toaster:brushes/"||value("filenam")||"."||value("height"))
  73. call set_char(face,value("filenam")||"."||value("height"))
  74. call req_tell("Converted and loaded:",value("filenam")||"."||value("height"))
  75.  
  76. call req_bar("ToasterCG")
  77. call REMLIB(CG_AREXX)
  78.  
  79. exit
  80.  
  81.  
  82.  
  83.  
  84.  
  85.